package com.sanctity.service.impl;

import com.sanctity.domain.User;
import com.sanctity.mapper.UserMapper;
import com.sanctity.service.UserService;
import com.sanctity.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/***
 * @belongsProject spring-cloud
 * @description <TODO description class purpose>
 * @author Sanct
 * @version 1.0.0
 * @create 2024/1/16 20:34
 **/
@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public UserVo findById(Integer id) {
        User user = userMapper.selectByPrimaryKey(id);
        UserVo userVo = new UserVo(user.getId(), user.getUsername(), user.getAddress());
        return userVo;
    }
}
